<?php 
class Main 
{ 
    public $a; 
    
    public function __construct() 
    { 
        echo '::Parent Class initiated::'; 
        
        $this -> a = 'we are in the parent class'; 
    } 
} 

class Child extends Main 
{ 
    public function getA() 
    { 
        return $this -> a; 
    } 
} 

$main = new Main(); 
$main -> child = new Child; 

echo $main -> child -> getA();